<?php
/**
 * Contains information about ordering of a data table - field and direction.
 * @author jan
 */
class SortOrder {

    public static $ASC = 'ASC';
    public static $DESC = 'DESC';
    
    public $field;
    public $direction;

    public function __construct($field = NULL, $direction = NULL) {
        $this->field = $field;
        $this->direction = $direction;
    }

    public function toSql() {
        return $this->field . ' ' . $this->direction;
    }
}
